<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
  <head>
    <base href="<%=basePath%>">
    <title>查看车位信息</title>        
	<link href="css/bootstrap.css" rel="stylesheet">
	<link href="css/flat-ui.css" rel="stylesheet">
	<style type="text/css">  
html{height:100%}  
body{height:100%;margin:0px;padding:0px}  
#container{height:100%}  
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=ytgswzBCTPt5giamH0WQv6aF">
//v2.0版本的引用方式：src="http://api.map.baidu.com/api?v=2.0&ak=您的密钥"
//v1.4版本及以前版本的引用方式：src="http://api.map.baidu.com/api?v=1.4&key=您的密钥&callback=initialize"
</script> 
  </head>
  
  <body style="background-image:url('images/bg1.gif')">
  <form action="parkUpdateSuccess.action" method="post" name = "myform" onsubmit="return checkdata();">
    <table>
    	<tr>
    		<td>停车场名称:</td>
    		<td><input type="text" value="<s:property value="parkstab.name"/>" id="name" name="name"  class="form-control" placeholder="name" onblur="checkName(this.value)"/></td>
    		<td><span id="nameERR"></span></td>
    	</tr>
    	<tr>
    		<td>停车场电话:</td>
    		<td><input type="text" value="<s:property value="parkstab.telNumber"/>" id="telNumber" name="telNumber" class="form-control" placeholder="telephone number" onblur="checkTelNumber(this.value)" /></td>
    		<td><span id="telNumberERR"></span></td>
    	</tr>
    	<tr>
    		<td>总车位数:</td>
    		<td><input type="text" value="<s:property value="parkstab.totalSpace"/>" id="totalSpace" name="totalSpace" class="form-control" placeholder="total Space" onblur="checkTotalSpace(this.value)"/></td>
    		<td><span id="totalSpaceERR"></span></td>
    	</tr>
    	<tr>
    		<td>剩余车位数:</td>
    		<td><input type="text" value="<s:property value="parkstab.emptySpace"/>" id="emptySpace" name="emptySpace" class="form-control" placeholder="empty Space" onblur="checkEmptySpace(this.value)"/></td>
    		<td><span id="emptySpaceERR"></span></td>
    	</tr>
    	<tr>
    		<td>停车场描述:</td>
    		<td>
	    		<textarea rows="3" cols="36" id="description" name="description"  style="width:200px;height:70px;" class="form-control" placeholder="Parking description"><s:property value="parkstab.description"/></textarea>
			</td>
    	</tr>
    	<tr>
    		<td>地址:</td>
    		<td><input type="text" value="<s:property value="parkstab.address"/>" id="address" name="address" class="form-control" placeholder="address" onblur="checkAddress(this.value)"/></td>
    		<td><span id="addressERR"></span></td>
    	</tr>
    	<tr>
    		<td>预定收费(/小时):</td>
    		<td><input type="text" value="<s:property value="parkstab.price"/>" id="price" name="price" class="form-control" placeholder="price pre hour" onblur="checkPrice(this.value)"/></td>
    		<td><span id="priceERR"></span></td>
    	</tr>
    	<tr>
    		<td>最长预留时间:</td>
    		<td><input type="text" value="<s:property value="parkstab.maxOrderTime"/>" id="maxOrderTime" name="maxOrderTime" class="form-control" placeholder="max order time" onblur="checkMaxOrderTime(this.value)"/></td>
    		<td><span id="maxOrderTimeERR"></span></td>
    	</tr>
    	<tr>
    		<td>经纬度:</td>
    		<td>	
	    		<input type="text" value="<s:property value="parkstab.longitude"/>" style="width:90px;" id="longitude" name="longitude" class="form-control" placeholder="longitude" onblur="checkLongitude(this.value)"/>
    			<input type="text" value="<s:property value="parkstab.latitude"/>" style="width:90px;" id="latitude" name="latitude" class="form-control" placeholder="latitude" onblur="checkLatitude(this.value)"/>
    			<span id="longitudeERR"></span>
    			<span id="latitudeERR"></span>
    		</td>
    		<td>
    			
    		</td>
    	</tr>
    	<tr>
    		<td></td>
    		<td>
    			<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal">点击选取</button>
    			<button class="btn btn-primary" type="submit">提交</button>
    		</td>
    	</tr>
    </table>
  </form>
  <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  
	  <div class="modal-dialog" style="margin:0% 15%;">
	    <div class="modal-content" style="width:900px;heigth:100px;" >
	      <div class="modal-header" style="background:#1ABC9C;">
	        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
	      </div>
	      <div id="container" class="modal-body">
	      
	       	<script type="text/javascript"> 
				var map = new BMap.Map("container");          // 创建地图实例  
				var point = new BMap.Point(120.61,31.30);  // 创建点坐标  
				map.centerAndZoom(point, 11);                 // 初始化地图，设置中心点坐标和地图级别  
				map.enableScrollWheelZoom(true);             //开启鼠标滚轮缩放
				map.addEventListener("click",function(e){
					
					document.getElementById("longitude").value=e.point.lng;
					document.getElementById("latitude").value=e.point.lat;
					alert("获取成功！");
				});
			</script>
	      </div>
	    </div><!-- /.modal-content -->
	  </div><!-- /.modal-dialog -->
	</div><!-- /.modal -->
	
   <!-- Load JS here for greater good =============================-->
    <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/jquery-ui-1.10.3.custom.min.js"></script>
    <script src="js/jquery.ui.touch-punch.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/bootstrap-select.js"></script>
    <script src="js/bootstrap-switch.js"></script>
    <script src="js/flatui-checkbox.js"></script>
    <script src="js/flatui-radio.js"></script>
    <script src="js/jquery.tagsinput.js"></script>
    <script src="js/jquery.placeholder.js"></script>       
    <!-- <script src="js/checkdata-park.js"></script> -->
  </body>
</html>
